package org.jeecg.modules.zhima.portal.enums;

public enum PlayerLevel {

    LEVEL_0(0, 0, 100,"青铜"),
    LEVEL_1(1, 100, 1000,"白银"),
    LEVEL_2(2, 1000, 5000,"黄金"),
    LEVEL_3(3, 5000, 10000,"铂金"),
    LEVEL_4(4, 10000, 50000,"砖石"),
    LEVEL_5(5, 50000, 100000,"超凡大师"),
    LEVEL_6(6, 100000, 1000000,"傲视宗师"),
    LEVEL_7(7, 1000000, 100000000,"最强王者");

    public Integer LEVEL;

    public Integer MIN;

    public Integer MAX;

    public String TXT;

     PlayerLevel(Integer level, Integer min, Integer max, String txt){
        this.LEVEL = level;
        this.MIN = min;
        this.MAX = max;
        this.TXT = txt;
    }

    public static PlayerLevel getByScore(Integer score){
         if (score >= LEVEL_0.MIN && score <= LEVEL_0.MAX){
             return LEVEL_0;
         }else if (score >= LEVEL_1.MIN && score < LEVEL_1.MAX){
             return LEVEL_1;
         }else if (score >= LEVEL_2.MIN && score < LEVEL_2.MAX){
             return LEVEL_2;
         }else if (score >= LEVEL_3.MIN && score < LEVEL_3.MAX){
             return LEVEL_3;
         }else if (score >= LEVEL_4.MIN && score < LEVEL_4.MAX){
             return LEVEL_4;
         }else if (score >= LEVEL_5.MIN && score < LEVEL_5.MAX){
             return LEVEL_5;
         }else if (score >= LEVEL_6.MIN && score < LEVEL_6.MAX){
             return LEVEL_6;
         }else if (score >= LEVEL_7.MIN && score < LEVEL_7.MAX){
             return LEVEL_7;
         }else {
             return LEVEL_0;
         }
    }

    public static PlayerLevel getByLevel(Integer level){
        switch (level){
            case 1:
                return LEVEL_1;
            case 2:
                return LEVEL_2;
            case 3:
                return LEVEL_3;
            case 4:
                return LEVEL_4;
            case 5:
                return LEVEL_5;
            case 6:
                return LEVEL_6;
            case 7:
                return LEVEL_7;
            case 0:
            default:
                return LEVEL_0;
        }
    }

    public static void main(String[] args) {
        int i = 1000000000;
        System.out.printf(""+(i+i));
    }
}
